<html>
<head><meta charset="utf-8"><title>cargo -Ztiming for parallel codegen · t-compiler/wg-parallel-rustc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/index.html">t-compiler/wg-parallel-rustc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html">cargo -Ztiming for parallel codegen</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176965648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965648">(Sep 30 2019 at 19:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> do you perhaps have some insight into how hard it'd be to hook up parallel codegen "steps" to -Ztiming graphs from Cargo? In particular, I'd like to get some insight into how much parallelism we're getting in the codegen stage today</p>



<a name="176965679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965679">(Sep 30 2019 at 19:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> not necessarily the hardest thing in the world but also probably not the easiest</p>



<a name="176965683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965683">(Sep 30 2019 at 19:33)</a>:</h4>
<p>Basically wondering if it makes sense to try and invest 3-4 hours or so to get that for the parallel data graphs so we can compare more easily, or if it's probably relatively hard and not worth it</p>



<a name="176965730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965730">(Sep 30 2019 at 19:34)</a>:</h4>
<p>the way to do it would be to have rustc emit more json blobs</p>



<a name="176965745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965745">(Sep 30 2019 at 19:34)</a>:</h4>
<p>and cargo reads those and records what time it reads those</p>



<a name="176965757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965757">(Sep 30 2019 at 19:34)</a>:</h4>
<p>tbh using <code>-Z self-profile</code> was pretty good for this purpose</p>



<a name="176965780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965780">(Sep 30 2019 at 19:34)</a>:</h4>
<p>although seeing parallelism is hard you can see when cgus are produced</p>



<a name="176965833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965833">(Sep 30 2019 at 19:35)</a>:</h4>
<p>yeah, the parallelism is of particular interest to this concern</p>



<a name="176965859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965859">(Sep 30 2019 at 19:35)</a>:</h4>
<p>but sounds like it wouldn't be the hardest thing so I might take a stab and see if I can get anywhere in a couple hours and if not give up for now</p>



<a name="176965866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965866">(Sep 30 2019 at 19:35)</a>:</h4>
<p>I think it might be worth it</p>



<a name="176965883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965883">(Sep 30 2019 at 19:36)</a>:</h4>
<p>(depending on how "interesting" the data is, I guess)</p>



<a name="176965962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965962">(Sep 30 2019 at 19:36)</a>:</h4>
<p>there was a really old option for this</p>



<a name="176965971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965971">(Sep 30 2019 at 19:36)</a>:</h4>
<p>like <code>-Z timings-graph</code></p>



<a name="176965981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176965981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176965981">(Sep 30 2019 at 19:36)</a>:</h4>
<p>but I think it's since been gutted and turned off</p>



<a name="176966005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176966005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176966005">(Sep 30 2019 at 19:37)</a>:</h4>
<p><code>-Z codegen-time-graph</code></p>



<a name="176966013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176966013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176966013">(Sep 30 2019 at 19:37)</a>:</h4>
<p>I don't think it does anything any more though</p>



<a name="176966322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176966322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176966322">(Sep 30 2019 at 19:40)</a>:</h4>
<p>Yeah, it does nothing today</p>



<a name="176966341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/176966341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#176966341">(Sep 30 2019 at 19:40)</a>:</h4>
<p>I'd want the data on the cargo graph anyway</p>



<a name="177173968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/177173968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#177173968">(Oct 02 2019 at 17:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> just saw <a href="https://perf.rust-lang.org/compare.html?start=702b45e409495a41afcccbe87a251a692b0cefab&amp;end=dc78b8ba143915e07375e9d7f05838222cb1db3e&amp;stat=wall-time" target="_blank" title="https://perf.rust-lang.org/compare.html?start=702b45e409495a41afcccbe87a251a692b0cefab&amp;end=dc78b8ba143915e07375e9d7f05838222cb1db3e&amp;stat=wall-time">https://perf.rust-lang.org/compare.html?start=702b45e409495a41afcccbe87a251a692b0cefab&amp;end=dc78b8ba143915e07375e9d7f05838222cb1db3e&amp;stat=wall-time</a> doesn't look too bad for a first bench :)</p>



<a name="177174040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/177174040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#177174040">(Oct 02 2019 at 17:43)</a>:</h4>
<p>did you open a PR and run perf using bots?</p>



<a name="177174049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/177174049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#177174049">(Oct 02 2019 at 17:43)</a>:</h4>
<p>yeah, it's not terrible -- I'll be doing some more benchmarking in the next few days as well, but was pretty happy with that. 5-20% regressions in the "worst" case (locks w/o threads) is pretty good</p>



<a name="177174085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/177174085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#177174085">(Oct 02 2019 at 17:43)</a>:</h4>
<p>yeah, that's a normal perf run (<a href="https://github.com/rust-lang/rust/pull/64936" target="_blank" title="https://github.com/rust-lang/rust/pull/64936">https://github.com/rust-lang/rust/pull/64936</a>) -- I'll be rerunning it to get self profile data as well</p>



<a name="177174197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo%20-Ztiming%20for%20parallel%20codegen/near/177174197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/187679-t-compiler/wg-parallel-rustc/topic/cargo.20-Ztiming.20for.20parallel.20codegen.html#177174197">(Oct 02 2019 at 17:44)</a>:</h4>
<p>yeah, I wonder how would it look like as soon as you do <code>-Zthreads=more_than_one parallel</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>